package com.scanner.util;

import android.annotation.SuppressLint;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DataUtil {
    static SimpleDateFormat format;
    /** 日期格式：yyyy-MM-dd HH:mm **/
    public static final String DF_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
    public static final String DF_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:SS";
    /** 当前时间 如: 20130422 */
    @SuppressLint("SimpleDateFormat")
    public static String getCurrentDateString() {
        format = new SimpleDateFormat(DF_YYYY_MM_DD_HH_MM);
        return format.format(Calendar.getInstance().getTime());
    }

    @SuppressLint("SimpleDateFormat")
    public static String getCurrentDateStringTw() {
        format = new SimpleDateFormat(DF_YYYY_MM_DD_HH_MM_SS);
        return format.format(Calendar.getInstance().getTime());
    }

}
